package com.pureut.equipment.api;


import com.pureut.common.core.constant.ServiceNameConstants;
import com.pureut.common.core.web.domain.AjaxResult;
import com.pureut.equipment.api.factory.RemoteEquipmentFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author: CM
 * @date: 2023/5/6    11:19
 */
@FeignClient(contextId = "FeignEquipmentService", value = ServiceNameConstants.PUREUT_EQUIPMENT, fallbackFactory = RemoteEquipmentFallbackFactory.class)
public interface FeignEquipmentService {

    /**
     * 水刺看板-获取设备状态信息
     * @param lineCode
     * @return
     */
    @GetMapping("/device/getDeviceCondition")
    public AjaxResult getDeviceCondition(@RequestParam("lineCode") String lineCode);


    /**
     * 获取设备名称，设备类型
     * @param deviceCode
     * @return
     */
    @GetMapping("/device/getDeviceInfo")
    public AjaxResult getDeviceInfo(@RequestParam("deviceCode") String deviceCode);

    /**
     * 根据保养计划开始时间和结束时间定时修改计划状态(定时任务调用)
     */
    @PostMapping("/maintenance-plan/updateMaintenanceStatusByTime")
    public AjaxResult updateMaintenanceStatusByTime();

    /**
     * 根据点检计划开始时间和结束时间定时修改计划状态(定时任务调用)
     */
    @PostMapping("/inspection-item-plan/updateInspectionStatusByTime")
    public AjaxResult updateInspectionStatusByTime();

    /**
     * 根据巡检计划开始时间和结束时间定时修改计划状态(定时任务调用)
     */
    @PostMapping("/patrol-item-plan/updatePatrolStatusByTime")
    public AjaxResult updatePatrolStatusByTime();

    /**
     * 触发生成工单
     */
    @PostMapping("/schedulignTask/generatingWorkOrder")
    public void generationWorkOrder();
}
